<?php include '/header.php'; ?>
<link rel='stylesheet' href='<?php echo css_url() . '960grid/960.css' ?>' />
<link rel="stylesheet" type="text/css" href="<?php echo css_url() . 'display_style.css' ?>">

<section id="body">
    <div class="body-container">
        <?php //var_dump($DesInfo); ?>
        <div class="panel-holder">
            <div class="heading">Recruiter Information</div>
            <!-- Basic information -->
            <div id="basic-information">
                <div class="container_12 margin-bottom">
                    <div class="grid_3 text">
                        <image src="<?php echo $DesInfo['AvatarLink']?>" style="width:100%"/> 
                    </div>

                    <div class="grid_2 text-head">
                        Email:<br><br> 
                        Company Name:<br><br>
                        Websites:
                    </div>
                    <div class="grid_2 text">
                        <?php echo $DesInfo['RelUserEmail'];?><br><br>
                        <?php echo $DesInfo['CompanyName'];?><br><br>
                        <?php  
                            $WebTemp = explode("#",$DesInfo['Websites']);
                            $WebTemp = implode("<br>", $WebTemp);
                            echo $WebTemp;
                        ?>
                    </div>
                </div>
            </div>
            
            <!-- Contact Section -->
            <div id="contact-section">
                <div class="container_12 margin-bottom">
                    <div class="grid_2 text-head">
                        Locations: 
                    </div>
                </div>
                
                <?php foreach($DesInfo['Locations'] as $Location):?>
                <div class="container_12 margin-bottom">
                    <div class="grid_1 text-head">&nbsp;</div>
                    <div class="grid_2 text-head"><?php echo $Location['Name'];?></div>
                </div>
                
                <!-- Address Field -->
                <?php
                    $AddrArray = explode('#', $Location['Address']);
                ?>
                <div class="container_12 margin-bottom">
                    <div class="grid_2 text-head">&nbsp;</div>
                    <div class="grid_1 text-head">Address:</div>
                    <div class="grid_2 text" style="font-weight: 600; text-align: right;">
                        Province:<br><br>
                        District:
                    </div>
                    <div class="grid_2 text">
                        <?php 
                        if(!empty($AddrArray[0]))
                            echo $AddrArray[0].'<br><br>';
                        else
                            echo 'None'.'<br><br>';
                        ?>
                        <?php echo $AddrArray[2];?>
                    </div>
                    <div class="grid_1 text" style="font-weight: 600; text-align: right;">
                        City:<br><br>
                        Street:
                    </div>
                    <div class="grid_3 text">
                        <?php 
                        if(!empty($AddrArray[1]))
                            echo $AddrArray[1].'<br><br>';
                        else
                            echo 'None'.'<br><br>';
                        ?>
                        <?php echo $AddrArray[3];?>
                    </div>
                </div>  
                
                <!-- Phone Fields -->
                <div class="container_12 margin-bottom">
                    <div class="grid_2 text-head">&nbsp;</div>
                    <div class="grid_1 text-head">
                        Phone:
                    </div>

                    <div class="grid_8 text">
                        <?php
                            $AddrPhones = explode('#',$Location['Phones']);
                            $Temp = implode(' - ', $AddrPhones);
                            echo $Temp;
                        ?>
                    </div>
                </div> 
                
                <!-- More About -->
                <?php if(!empty($Location['Describtion'])):?>
                <div class="container_12 margin-bottom">
                    <div class="grid_2 text-head">&nbsp;</div>
                    
                    <div class="grid_1 text-head">
                        More:
                    </div>
                    
                    <div class="grid_8 text">
                        <?php echo $Location['Describtion']; ?>
                    </div>               
                </div>
                <?php endif;?>
                
                <!-- Map -->
                <?php if(!empty($Location['GoogleLink'])):?>
                <div class="container_12 margin-bottom">
                    <div class="grid_2">&nbsp;</div>
                    <div class="grid_10">
                        <button class="show-map">Show Map</button>
                    </div>
                </div>
                
                <div class="container_12 margin-bottom" IsMap style="position: absolute;left: -10000px;">
                    <div class="grid_2">&nbsp;</div>
                    <div class="grid_10">
                        <iframe width="100%" height="500px" src="<?php echo $Location['GoogleLink'];?>"></iframe>
                    </div>
                </div>
                <?php endif;?>
                <?php endforeach;?>
            </div>
            
            <div class="container_12 margin-bottom"></div>
            
            <!-- Describtion About Company -->
            <?php if(!empty($DesInfo['Describtion'])):?>
            <div class="container_12 margin-bottom">
                <div class="grid_4 text-head">
                    Describtion About The Company:
                </div>
            </div>
            
            <div class="container_12 margin-bottom">
                <div class="grid_2 text-head">
                    &nbsp;
                </div>
                <div class="grid_10 text">
                    <?php echo $DesInfo['Describtion']; ?>
                </div>
            </div>
            <?php endif;?>
        </div> 
    </div>
</section>

<script>
    
    var button_show_map = function(){$('button.show-map').on('click',function(){
        $(this).parent().parent().next().css('left','0px');
        $(this).parent().parent().next().css('position','');
        
        $(this).attr('class','hide-map');
        $(this).text("Hide Map");
        button_hide_map();
    });}

    var button_hide_map = function(){$('button.hide-map').on('click',function(){
        $(this).parent().parent().next().css('left','-10000px');
        $(this).parent().parent().next().css('position','absolute');
        
        $(this).attr('class','show-map');
        $(this).text("Show Map");
        button_show_map();
    });}

    button_show_map();
</script>

<?php include '/../footer.php'; ?>
